﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using unTroublemaker.Conditions;

namespace unTroublemaker.Tests.Conditions
{
    [TestClass]
    public class RegistryConditionTests
    {
        [TestMethod, TestCategory("UnitTest")]
        public void GivenACorrectRegistryPassesTest()
        {
            var registryTest = new RegistryCondition(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesPath", @"C:\Program Files (x86)");
            registryTest.Run();
            Assert.IsTrue(registryTest.Passed);
        }

        [TestMethod, TestCategory("UnitTest")]
        public void GivenAnIncorrectRegistryFailsTest()
        {
            var registryTest = new RegistryCondition(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesPath", "%Invalid%");
            registryTest.Run();
            Assert.IsFalse(registryTest.Passed);
        }
    }
}
